import math

from django.http import HttpResponse
from django.shortcuts import render
import datetime
def hello(request):
    context = {}
    context['hello'] = "Hello World ！"
    context['name'] = "admin"
    context['list'] = [3,2,5,8,4,7,6,9]
    context['dict'] = {"name":"jack","age":"23","lesson":"python"}
    context['time'] = datetime.datetime.now()
    context['str'] = "这里使用 render 来替代之前使用的"
    context['views_str'] = "<a href='https://www.runoob.com/'>点击跳转</a>"
    context['num'] = 91
    context['list'] = ["jack","oliver","john","alax","auger"]
    return render(request, 'hello.html', context)
    """这里使用 render 来替代之前使用的 HttpResponse。render 还使用了一个字典 context 作为参数。
    context 字典中元素的键值 hello 对应了模板中hello.html的变量 {{ hello }}。"""
    #return HttpResponse("Hello world");